//
//  DMScrollView.m
//  ScrollView
//
//  Created by weiguang on 2017/1/22.
//  Copyright © 2017年 weiguang. All rights reserved.
//

#import "DMScrollView.h"

@implementation DMScrollView

@synthesize responseInsets;

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
    
    CGPoint parentLocation = [self convertPoint:point toView:[self superview]];
    CGRect responseRect = self.frame;
    responseRect.origin.x -= responseInsets.left;
    responseRect.origin.y -= responseInsets.top;
    responseRect.size.width += (responseInsets.left + responseInsets.right);
    responseRect.size.height += (responseInsets.top + responseInsets.bottom);
    
    return CGRectContainsPoint(responseRect, parentLocation);
}

//- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
//     return [self pointInside:point withEvent:event] ? scrollView : nil;
//}

@end
